#ifndef _Mapping_Node_Handler_H_
#define _Mapping_Node_Handler_H_

#include "xMappingNodeTypeLibrary.h"
#include <string>
#include <map>

class MappingNodeHandler{

public:
	static MappingNodeHandler* getInstance();
	std::vector<xMappingNodeTypeDescriptor*>* getNodeList(const std::string category) ;
	std::vector<xMappingNodeTypeDescriptor*>* getNodeList(const int index) ;
	void addNode(xMappingNodeTypeDescriptor* des);
	std::vector<std::string>* getCategorys();
	void refreshNodeList();
	void saveVMToLibrary(std::string name,std::string type,std::string des,xMappingTree* xmt);
	void deleteVMFromLibrary(std::string name);

private:
	MappingNodeHandler();
	void addCategory(std::string category);
	int _node_number;							
	static MappingNodeHandler* _selector;
	std::vector<std::string> _node_categorys;
	std::map<std::string,std::vector<xMappingNodeTypeDescriptor*>> _node_map;
};

#endif 